﻿using JTTD.Domain.Dtos;
using JTTD.Domain.Dtos.Coupon.Request;
using JTTD.Domain.Dtos.Coupon.Response;
using System.Threading.Tasks;

namespace JTTD.Domain.IService
{
    /// <summary>
    /// 商城优惠券服务
    /// </summary>
   public   interface ICouponService : IDependency
    {

        /// <summary>
        /// 分页获取所有停车优惠券
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult<PageResult<CouponInfoResponseDto>>> GetAllCouponPageList( CouponSearchRequestDto dto);

        /// <summary>
        /// 分页获取指定用户能使用的商城优惠券
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ApiResult<PageResult<CouponInfoResponseDto>>> GetCouponPageList(int userId,BaseSearch dto);

        /// <summary>
        /// 兑换商城优惠券
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="amount"></param>
        /// <returns></returns>
        Task<ApiResult<bool>> ExchangeCoupon(int userId,decimal amount);

        /// <summary>
        /// 更改商城优惠券使用状态
        /// </summary>
        /// <param name="couponNumber"></param>
        /// <param name="isUser"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<ApiResult<bool>> ChangeUseState(string couponNumber,bool isUser,int? userId=null);

        /// <summary>
        /// 赠送商城优惠券
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="amount"></param>
        /// <returns></returns>
        Task<ApiResult<bool>> SendCoupon(int userId, decimal amount);

        /// <summary>
        /// 删除商城优惠券
        /// </summary>
        /// <param name="couponNumber"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<ApiResult<bool>> DeleteCoupon(string couponNumber,int userId);
       
    }
}
